
import 'package:flutter/material.dart';

import '../my_colors.dart';
import 'app_bar.dart';

class BaseScaffold extends StatefulWidget {
  final String? title;
  final Widget body;
  final Widget? titleWidegt;
  final Function? rightItemCallBack;
  final Function? leftItemCallBack;
  final bool? isSafe;
  final Color? backgroundColor;
  final bool? hidenAppBar;

   const BaseScaffold({super.key,   this.title ,  required this.body,   this.rightItemCallBack ,  this.leftItemCallBack,  this.isSafe,this.backgroundColor,  this.titleWidegt, this.hidenAppBar = false  });
  @override
  _BaseScaffoldState createState() => _BaseScaffoldState();
}

class _BaseScaffoldState extends State<BaseScaffold> {

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  void dispose() {
    super.dispose();
  }
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return widget.hidenAppBar!?Scaffold(
      backgroundColor:widget.backgroundColor?? MyColors.colorF1F1F1,
      // resizeToAvoidBottomInset: false,
      body: widget.body,): Scaffold(
            backgroundColor:widget.backgroundColor?? MyColors.colorF1F1F1,
            // resizeToAvoidBottomInset: false,
            appBar: BaseAppBar(
                  context,
                  titleWidget: widget.titleWidegt,
                  title: widget.title??'',
                  rightItemCallBack: widget.rightItemCallBack,
                  leftItemCallBack: widget.leftItemCallBack,
                ),
            body: widget.body,);
  }
}
